﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Framework.UI.Controls"
                    xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:metro="http://schemas.codeplex.com/elysium"
                    xmlns:params="http://schemas.codeplex.com/elysium/params">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Elysium;component/Themes/Generic.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Converter.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Validation.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Controls/Button.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Controls/TextBlock.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/Elysium/CommandButton.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/CalloutContentControl.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/FlipControl.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/PagingItemsControl.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Duration x:Key="TransitionDuration">0:0:0.6</Duration>
    <Style x:Key="WizardItemStyle" TargetType="{x:Type ContentControl}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <ControlTemplate.Resources>
                        <Style TargetType="{x:Type Path}">
                            <Setter Property="Fill" Value="{StaticResource LowlightBrush}"/>
                            <Setter Property="Stretch" Value="Uniform"/>
                        </Style>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <ContentControl Grid.Column="0" 
                                        Grid.RowSpan="4"
                                        Content="{Binding Icon}"
                                        ContentTemplate="{Binding IconTemplate}"
                                        Focusable="False"
                                        Foreground="{StaticResource LowlightBrush}"
                                        Height="50"
                                        Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                        Visibility="{Binding Converter={StaticResource NullToVisibilityConverter}, Path=Icon}"
                                        Width="50"/>

                        <TextBlock Grid.Column="1" 
                                   Grid.Row="1"
                                   Foreground="{TemplateBinding Foreground}"
                                   Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                   Style="{StaticResource HeaderTextStyle}"
                                   Text="{Binding Title}"
                                   TextWrapping="Wrap"
                                   VerticalAlignment="Center"/>

                        <TextBlock Grid.Column="1" 
                                   Grid.Row="2"
                                   Foreground="{StaticResource AccentBrush}"
                                   Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Right, Bottom', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                   Style="{StaticResource NormalTextStyle}"
                                   Text="{Binding Description}"
                                   TextWrapping="Wrap"
                                   VerticalAlignment="Center"/>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="WizardItemTitleStyle" TargetType="{x:Type ContentControl}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <TextBlock x:Name="PART_Text" 
                               ToolTipService.ShowOnDisabled="True"
                               Foreground="{TemplateBinding Foreground}"
                               Style="{StaticResource HeaderTextStyle}"
                               Text="{Binding ShortTitle}"
                               VerticalAlignment="Center">
                        <TextBlock.ToolTip>
                            <ToolTip>
                                <ContentControl Style="{StaticResource WizardItemStyle}"/>
                            </ToolTip>
                        </TextBlock.ToolTip>
                    </TextBlock>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" TargetName="PART_Text" Value="{StaticResource ForegroundBrush}"/>
                        </Trigger>
                        <DataTrigger Binding="{Binding ShortTitle}" Value="{x:Null}">
                            <Setter Property="Text" TargetName="PART_Text" Value="{Binding Title}"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="WizardItemButtonStyle" BasedOn="{StaticResource HyperlinkButtonStyle}" TargetType="{x:Type Button}">
        <!-- CommandParameter must come before Command so that CanExecute will not be passed null. -->
        <Setter Property="CommandParameter" Value="{Binding}"/>
        <Setter Property="Command" Value="{Binding SelectCommand}"/>
        <Setter Property="Content" Value="{Binding}"/>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <ContentControl Focusable="False"
                                    Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}" 
                                    Style="{StaticResource WizardItemStyle}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
    </Style>
    <Style x:Key="WizardItemTitleButtonStyle" BasedOn="{StaticResource WizardItemButtonStyle}" TargetType="{x:Type Button}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <ContentControl Focusable="False"
                                    Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}" 
                                    Style="{StaticResource WizardItemTitleStyle}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <DataTemplate x:Key="CrumbDataTemplate">
        <ContentControl Focusable="False">
            <ContentControl.Style>
                <Style TargetType="{x:Type ContentControl}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <ControlTemplate.Resources>
                                    <Storyboard x:Key="EnteringStoryboard">
                                        <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
                                                         Storyboard.TargetName="PART_Button"
                                                         Duration="{StaticResource TransitionDuration}"
                                                         From="500"
                                                         To="0">
                                            <DoubleAnimation.EasingFunction>
                                                <QuadraticEase/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="PART_Button"
                                                         Duration="{StaticResource TransitionDuration}"
                                                         From="0"
                                                         To="1">
                                            <DoubleAnimation.EasingFunction>
                                                <QuadraticEase/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                    </Storyboard>
                                    <Storyboard x:Key="LeavingStoryboard">
                                        <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" 
                                                         Storyboard.TargetName="PART_Button"
                                                         Duration="{StaticResource TransitionDuration}"
                                                         From="0"
                                                         To="500">
                                            <DoubleAnimation.EasingFunction>
                                                <QuadraticEase/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="PART_Button"
                                                         Duration="{StaticResource TransitionDuration}"
                                                         From="1"
                                                         To="0">
                                            <DoubleAnimation.EasingFunction>
                                                <QuadraticEase/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" 
                                                         Storyboard.TargetName="PART_Arrow"
                                                         Duration="{StaticResource TransitionDuration}"
                                                         From="1"
                                                         To="0">
                                            <DoubleAnimation.EasingFunction>
                                                <QuadraticEase/>
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                    </Storyboard>
                                </ControlTemplate.Resources>
                                <StackPanel Orientation="Horizontal">
                                    <Button x:Name="PART_Button" 
                                            IsEnabled="{Binding Converter={StaticResource InverseBoolConverter}, Path=IsSelected}"
                                            Style="{StaticResource WizardItemTitleButtonStyle}">
                                        <Button.RenderTransform>
                                            <TranslateTransform/>
                                        </Button.RenderTransform>
                                    </Button>
                                    <Button x:Name="PART_Arrow"
                                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultThickness), Mode=OneWay}"
                                            Visibility="{Binding Converter={StaticResource InverseBoolToVisibilityConverter}, Path=IsSelected}">
                                        <Button.RenderTransform>
                                            <TranslateTransform/>
                                        </Button.RenderTransform>
                                        <Button.Style>
                                            <Style BasedOn="{StaticResource HyperlinkButtonStyle}" TargetType="Button">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Children.Count}" Value="1">
                                                        <Setter Property="IsEnabled" Value="False"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                        <Image Source="/Framework.UI;component/Assets/Divider.png"/>
                                    </Button>
                                    <Popup x:Name="PART_Popup"
                                           AllowsTransparency="True"
                                           PlacementTarget="{Binding ElementName=PART_Arrow}"
                                           StaysOpen="False">
                                        <controls:CalloutContentControl>
                                            <ScrollViewer VerticalScrollBarVisibility="Auto">
                                                <ItemsControl x:Name="PART_PopupChildren" 
                                                              ItemsSource="{Binding Children}" 
                                                              Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultThickness), Mode=OneWay}">
                                                    <interactivity:Interaction.Behaviors>
                                                        <controls:AnimatingItemsControlBehavior/>
                                                    </interactivity:Interaction.Behaviors>
                                                    <ItemsControl.ItemContainerStyle>
                                                        <Style TargetType="{x:Type ContentPresenter}">
                                                            <Setter Property="Visibility" Value="{Binding Converter={StaticResource InverseBoolToVisibilityConverter}, Path=IsVisited}"/>
                                                        </Style>
                                                    </ItemsControl.ItemContainerStyle>
                                                    <ItemsControl.ItemTemplate>
                                                        <DataTemplate>
                                                            <Button Style="{StaticResource WizardItemButtonStyle}"/>
                                                        </DataTemplate>
                                                    </ItemsControl.ItemTemplate>
                                                </ItemsControl>
                                            </ScrollViewer>
                                        </controls:CalloutContentControl>
                                    </Popup>
                                </StackPanel>
                                <ControlTemplate.Triggers>
                                    <EventTrigger RoutedEvent="Button.Click" SourceName="PART_Arrow">
                                        <EventTrigger.Actions>
                                            <BeginStoryboard x:Name="BeginOpenPopup">
                                                <Storyboard>
                                                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup"
                                                                                    Storyboard.TargetProperty="IsOpen">
                                                        <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                                                    </BooleanAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger.Actions>
                                    </EventTrigger>
                                    <EventTrigger RoutedEvent="PreviewMouseLeftButtonUp" SourceName="PART_PopupChildren">
                                        <EventTrigger.Actions>
                                            <StopStoryboard BeginStoryboardName="BeginOpenPopup"/>
                                            <BeginStoryboard x:Name="BeginClosePopup">
                                                <Storyboard>
                                                    <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup"
                                                                                    Storyboard.TargetProperty="IsOpen">
                                                        <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                                                    </BooleanAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger.Actions>
                                    </EventTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsEntering}" Value="True"/>
                                            <Condition Binding="{Binding Path=IsNavigatingForward, RelativeSource={RelativeSource AncestorType={x:Type controls:Wizard}}}" Value="True"/>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.EnterActions>
                                            <BeginStoryboard x:Name="BeginEnteringStoryboard"
                                                             Storyboard="{StaticResource EnteringStoryboard}"/>
                                        </MultiDataTrigger.EnterActions>
                                        <MultiDataTrigger.ExitActions>
                                            <StopStoryboard BeginStoryboardName="BeginEnteringStoryboard"/>
                                        </MultiDataTrigger.ExitActions>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsLeaving}" Value="True"/>
                                            <Condition Binding="{Binding Path=IsNavigatingBackward, RelativeSource={RelativeSource AncestorType={x:Type controls:Wizard}}}" Value="True"/>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.EnterActions>
                                            <BeginStoryboard x:Name="BeginLeavingStoryboard"
                                                             Storyboard="{StaticResource LeavingStoryboard}"/>
                                        </MultiDataTrigger.EnterActions>
                                        <MultiDataTrigger.ExitActions>
                                            <StopStoryboard BeginStoryboardName="BeginLeavingStoryboard"/>
                                        </MultiDataTrigger.ExitActions>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsEntering}" Value="True"/>
                                            <Condition Binding="{Binding Path=IsNavigatingHorizontally, RelativeSource={RelativeSource AncestorType={x:Type controls:Wizard}}}" Value="True"/>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.EnterActions>
                                            <BeginStoryboard x:Name="BeginEnteringHorizontallyStoryboard"
                                                             Storyboard="{StaticResource EnteringStoryboard}"/>
                                        </MultiDataTrigger.EnterActions>
                                        <MultiDataTrigger.ExitActions>
                                            <StopStoryboard BeginStoryboardName="BeginEnteringHorizontallyStoryboard"/>
                                        </MultiDataTrigger.ExitActions>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsLeaving}" Value="True"/>
                                            <Condition Binding="{Binding Path=IsNavigatingHorizontally, RelativeSource={RelativeSource AncestorType={x:Type controls:Wizard}}}" Value="True"/>
                                        </MultiDataTrigger.Conditions>
                                        <MultiDataTrigger.EnterActions>
                                            <BeginStoryboard x:Name="BeginLeavingHorizontallyStoryboard"
                                                             Storyboard="{StaticResource LeavingStoryboard}"/>
                                        </MultiDataTrigger.EnterActions>
                                        <MultiDataTrigger.ExitActions>
                                            <StopStoryboard BeginStoryboardName="BeginLeavingHorizontallyStoryboard"/>
                                        </MultiDataTrigger.ExitActions>
                                    </MultiDataTrigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ContentControl.Style>
        </ContentControl>
    </DataTemplate>
    <DataTemplate x:Key="PagingWizardItemContentTemplate">
        <ItemsControl controls:Wizard.CollectionAnimation="Sequential"
                      ItemsSource="{Binding Path=Model.Children, RelativeSource={RelativeSource AncestorType={x:Type controls:WizardItem}}}"
                      MinWidth="460"
                      Style="{StaticResource PagingItemsControl}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Style="{StaticResource WizardItemButtonStyle}"
                            Visibility="{Binding Visibility}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <DataTemplate x:Key="WrapPanelWizardItemContentTemplate">
        <ItemsControl controls:Wizard.CollectionAnimation="Sequential"
                      ItemsSource="{Binding Path=Model.Children, RelativeSource={RelativeSource AncestorType={x:Type controls:WizardItem}}}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <controls:AnimatedWrapPanel/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button MinWidth="460" 
                            Style="{StaticResource WizardItemButtonStyle}"
                            Visibility="{Binding Visibility}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <Style x:Key="{x:Type controls:WizardItem}" TargetType="{x:Type controls:WizardItem}">
        <Setter Property="Background" Value="{StaticResource TransparentBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TransparentBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="IconTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Path Data="{Binding}" 
                          Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=ContentControl}}" 
                          SnapsToDevicePixels="True"
                          Stretch="Uniform"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Padding" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"/>
        <Setter Property="ContentTemplate" Value="{StaticResource PagingWizardItemContentTemplate}"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:WizardItem}">
                    <ContentPresenter Margin="{TemplateBinding Padding}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type controls:Wizard}" TargetType="{x:Type controls:Wizard}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="TransitionDuration" Value="{StaticResource TransitionDuration}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:Wizard}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="EnteringStoryboard"
                                    Duration="{StaticResource TransitionDuration}">
                            <DoubleAnimation Storyboard.TargetName="PART_Title" 
                                             Storyboard.TargetProperty="Opacity"
                                             From="0"
                                             To="1"/>
                            <DoubleAnimation Storyboard.TargetName="PART_BackButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             From="0"
                                             To="1"/>
                            <DoubleAnimation Storyboard.TargetName="PART_ForwardButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             From="0"
                                             To="1"/>
                            <DoubleAnimation Storyboard.TargetName="PART_BreadcrumbForwardButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             From="0"
                                             To="1"/>
                        </Storyboard>
                        <Storyboard x:Key="LeavingStoryboard"
                                    Duration="{StaticResource TransitionDuration}">
                            <DoubleAnimation Storyboard.TargetName="PART_Title" 
                                             Storyboard.TargetProperty="Opacity"
                                             To="0"/>
                            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" 
                                             Storyboard.TargetName="PART_Title"
                                             From="0"
                                             To="-500">
                                <DoubleAnimation.EasingFunction>
                                    <QuadraticEase/>
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                            <DoubleAnimation Storyboard.TargetName="PART_BackButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             To="0"/>
                            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
                                             Storyboard.TargetName="PART_BackButton"
                                             From="0"
                                             To="-500">
                                <DoubleAnimation.EasingFunction>
                                    <QuadraticEase/>
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                            <DoubleAnimation Storyboard.TargetName="PART_ForwardButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             To="0"/>
                            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
                                             Storyboard.TargetName="PART_ForwardButton"
                                             From="0"
                                             To="500">
                                <DoubleAnimation.EasingFunction>
                                    <QuadraticEase/>
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                            <DoubleAnimation Storyboard.TargetName="PART_BreadcrumbForwardButton" 
                                             Storyboard.TargetProperty="Opacity"
                                             To="0"/>
                            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
                                             Storyboard.TargetName="PART_BreadcrumbForwardButton"
                                             From="0"
                                             To="500">
                                <DoubleAnimation.EasingFunction>
                                    <QuadraticEase/>
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>

                        <Border x:Name="PART_PreviousItemBorder"
                                Grid.ColumnSpan="3"
                                Grid.RowSpan="3"/>
                        <Border x:Name="PART_CurrentItemBorder"
                                Grid.ColumnSpan="3"
                                Grid.RowSpan="3"/>

                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <metro:CommandButton x:Name="PART_BackButton" 
                                                 Grid.Column="0" 
                                                 Grid.Row="0"
                                                 Command="{TemplateBinding BackCommand}" 
                                                 Margin="10"
                                                 Style="{StaticResource ArrowHeadLeftCommandButtonStyle}">
                                <metro:CommandButton.RenderTransform>
                                    <TranslateTransform/>
                                </metro:CommandButton.RenderTransform>
                            </metro:CommandButton>
                            <ContentControl x:Name="PART_Title" 
                                            Grid.Column="1" 
                                            Grid.Row="0"
                                            DataContext="{TemplateBinding DisplayItem}"
                                            HorizontalAlignment="Center"
                                            Margin="10"
                                            Style="{StaticResource WizardItemStyle}">
                                <ContentControl.RenderTransform>
                                    <TranslateTransform/>
                                </ContentControl.RenderTransform>
                            </ContentControl>
                            <metro:CommandButton x:Name="PART_ForwardButton" 
                                                 Grid.Column="2" 
                                                 Grid.Row="0"
                                                 Command="{TemplateBinding ForwardCommand}" 
                                                 Margin="10"
                                                 Style="{StaticResource ArrowHeadRightCommandButtonStyle}">
                                <metro:CommandButton.RenderTransform>
                                    <TranslateTransform/>
                                </metro:CommandButton.RenderTransform>
                            </metro:CommandButton>

                            <ItemsControl x:Name="PART_Breadcrumb" 
                                          Grid.ColumnSpan="2"
                                          Grid.Row="1"
                                          Focusable="False"
                                          ItemsSource="{TemplateBinding Breadcrumb}"
                                          ItemTemplate="{StaticResource CrumbDataTemplate}"
                                          Margin="10">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel Orientation="Horizontal"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                            <metro:CommandButton x:Name="PART_BreadcrumbForwardButton" 
                                                 Grid.Column="2" 
                                                 Grid.Row="1"
                                                 Command="{TemplateBinding ForwardCommand}" 
                                                 Margin="10"
                                                 Style="{StaticResource ArrowHeadRightCommandButtonStyle}"
                                                 Visibility="Collapsed">
                                <metro:CommandButton.RenderTransform>
                                    <TranslateTransform/>
                                </metro:CommandButton.RenderTransform>
                            </metro:CommandButton>

                            <ContentControl Grid.ColumnSpan="3" 
                                            Grid.Row="2" 
                                            Content="{Binding Path=DisplayItem, RelativeSource={RelativeSource TemplatedParent}}"
                                            Focusable="False"/>

                        </Grid>

                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding FallbackValue=False, Path=DisplayItem.IsEntering, RelativeSource={RelativeSource Self}}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard x:Name="BeginEnteringStoryboard" 
                                                 Storyboard="{StaticResource EnteringStoryboard}"/>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <StopStoryboard BeginStoryboardName="BeginEnteringStoryboard"/>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding FallbackValue=False, Path=DisplayItem.IsLeaving, RelativeSource={RelativeSource Self}}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard x:Name="BeginLeavingStoryboard" 
                                                 Storyboard="{StaticResource LeavingStoryboard}"/>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <StopStoryboard BeginStoryboardName="BeginLeavingStoryboard"/>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                        <Trigger Property="IsBackAllowed" Value="False">
                            <Setter Property="Visibility" TargetName="PART_BackButton" Value="Hidden"/>
                        </Trigger>
                        <DataTrigger Binding="{Binding FallbackValue=False, Path=DisplayItem.IsForwardVisible, RelativeSource={RelativeSource Self}}" Value="True">
                            <Setter Property="Visibility" TargetName="PART_BreadcrumbForwardButton" Value="Visible"/>
                        </DataTrigger>
                        <Trigger Property="IsForwardAllowed" Value="False">
                            <Setter Property="Visibility" TargetName="PART_ForwardButton" Value="Hidden"/>
                            <Setter Property="Visibility" TargetName="PART_BreadcrumbForwardButton" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Mode" Value="None">
                            <Setter Property="Visibility" TargetName="PART_BackButton" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_Title" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_ForwardButton" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_Breadcrumb" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_BreadcrumbForwardButton" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Mode" Value="Linear">
                            <Setter Property="Visibility" TargetName="PART_Breadcrumb" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_BreadcrumbForwardButton" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Mode" Value="Tree">
                            <Setter Property="Visibility" TargetName="PART_BackButton" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_Title" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="PART_ForwardButton" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>